1. Technical Field
The present invention relates to an image processing device and a registration data generation method conducted in the image processing. More particularly, the present invention relates to improvements in an image processing device for generating registration data related to a contour of an object according to image data acquired by an image acquiring unit.
2. Related Art
There is provided an image processing device in which the automatic discrimination of a work (an object to be inspected) is conducted as follows. According to image data obtained when the work is acquired, a contour of the object is extracted and matching processing is conducted on this contour. According to the above automatic discrimination, for example, it is possible to specify a type of moldings or parts made by press working. Further, it is possible to specify a position of a mark printed on a base board.
In this type matching processing, edge points are extracted from an acquired image obtained when the work is acquired. These edge points are extracted according to a change in the luminance level of adjoining pixels, and a contour image of an object is formed by thus extracted edge points. This contour image is matched with registration data and the work is discriminated according to the result of the matching.
Registration data used in the matching processing is made according to an acquired image obtained when a sample of the work is acquired. That is, the registration data is made when a line, the shape of which is predetermined, is fitted to the contour of the object on the acquired image with respect to the acquired image of the sample. This operation conducted on the contour of the object is called “fitting”, and a line obtained by fitting is called “a fitting line”. Specifically, the registration data is made in such a manner that an operator for operating the image processing device designates an appropriate size according to a contour of the object while the operator is enlarging, reducing and moving a line, the shape of which is predetermined, on an image plane on which the acquired image is displayed.
In the above image processing device, a size of the fitting line is designated according to an operation input given by the operator. Therefore, the size of the designated fitting line is different for each operator. Accordingly, the accuracy of fitting is low. Especially, in the case where blur is caused on an image because the image is out of focus or in the case where the image quality is deteriorated by noise, it is difficult for the operator to distinguish the contour of the object on the acquired image on the image plane. Therefore, the accuracy of fitting is further lowered.
Therefore, it is considered to take the following countermeasure. Edge points are extracted from the acquired image of the object. A regression calculation is conducted on the thus extracted edge points and the fitting lines are automatically found. However, this countermeasure is disadvantageous as follows. In the case where the object itself has a defect such as a portion which is broken off, it is impossible to obtain a desired fitting line.